<?php get_backend_header(array(
	'jquery/validate/jquery.validate.js',
        'jquery/validate/additional-methods.js',
	'group.js',
), array(
	'jquery/ui.jqgrid.css'
)); ?>

<h2 class="title"><?php echo ($group_id) ?  'Edit' : 'Add'; ?> Group</h2>

<form id="group_form" name="group_form" class="form">
	<input type="hidden" id="group_id" name="group_id" value="<?php echo $group_id; ?>" />

            <div class="unit">
                
                
                <div class="line">
                        <label for="" class="bold">Group name:</label>
                        <div class="field" style="height:auto">
                          <input type="text" name="group_name" id="group_name" value="<?php echo $group_name; ?>"/>
                        </div>
                </div>
                
                <div class="line">
                        <label for="" class="bold">Group password:</label>
                        <div class="field" style="height:auto">
                          <input type="text" name="group_password" id="group_password" value="<?php echo $password;?>"/>
                        </div>
                </div>
                
                <div class="line">
                        <label for="" class="bold">Instructor:</label>
                        <div class="field" style="height:auto">
                            <select name="instructor_id" id="instructor_id">
                                <option value="0">-Select Instructor-</option>
                                <?php echo html_options($instructors, 'user_id','user_id', 'fname',$fname, false); ?>
                            </select>
                        </div>
                </div>
                

            </div>


        <div class ="clear"></div>

	<div class="buttons">
		<button id="save" name="save">Save</button>
		<a href="<?php echo site_url('group/list_records'); ?>" id="cancel" name="cancel">Cancel</a>
	</div>
</form>


<script type="text/javascript">
        groupRules();


	$('#cancel').button({
		icons: {primary: 'ui-icon-arrowreturn-1-w'}
	});	
	
	$('#save').button({
		icons: {primary: 'ui-icon-disk'}
	}).click(function(e) {
		$(this).removeClass('ui-state-focus');
		$('#group_form').submit();
		e.preventDefault();
	});	

</script>

<?php get_backend_footer(); ?>
